﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Plumbing;
using Autodesk.Revit.UI.Selection;

namespace YArchitech.Revit
{
	public class PipeNoSlopeFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			return elem is Pipe && (elem as Pipe).GetParameter(BuiltInParameter.RBS_PIPE_SLOPE).AsDouble() < 1E-07;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			return false;
		}
	}
}
